<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 1. 导入vue的脚本文件-->
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
    <div id="app">
        <ul>
            <li v-for="user in userList">索引：{{user.id}},
                用户名：{{user.username}}
            </li>
        </ul>
    </div>
    <!-- 2. 创建Vue实例 -->
     <script>
        const vm = {
            data: function() {
                return {
                    userList: [
                        {id: 1, username: '张三'}, 
                        {id: 2, username: '李四'},
                        {id: 3, username: '王五'}
                    ]
                }
            }
        }
        const app = Vue.createApp(vm)
        app.mount('#app')
     </script>
    
</body>
</html>